<!DOCTYPE html>
<html lang="zh-Hans" xmlns:th="http://www.thymeleaf.org">
<head>
	<title>修改短信模板</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chorme=1">
    <meta name="renderer" content="webkit">
	<script src="/static/cqzd/js/boot.js"></script>
	<script src="/static/cqzd/js/national.js"></script>
</head>
<body>
	<div style="padding-top:5px">
		<div id="smstmpl_update_form">
			<input class="mini-hidden" name="action" value="update"/>
			<input class="mini-hidden" name="tmplId"/>
			<table style="width:100%;height:100%;table-layout:fixed;padding-right: 60px;line-height: 40px" class="mini-form-table" >
				<tr >
					<th class="mini-form-label" style="text-align: right;padding-right: 20px;width:45%;"><label for="tmplName$text">短信模板名称：</label></th>
					<td style="text-align: left;">
						<input id="tmplName" name="tmplName" class="mini-textbox mini-form-input" width="200px" required="true" />
					</td>

				</tr>
				<tr>
					<th class="mini-form-label" style="vertical-align:0px;text-align: right;padding-right: 20px;width:45%;"><label for="tmplContent$text">短信模板内容：</label></th>
					<td style="text-align: left;padding-top: 15px">
						<textarea class="mini-textarea" emptyText="请输入短信模板内容" style="height: 180px;width: 200px;text-indent:25px "  id="tmplContent"  required="true" name="tmplContent" >

						</textarea>
					</td>
				</tr>


			</table>
			<div class="oper-mini-toolbar" style="margin-top: 30px;padding-left: 40%" >
				<a class="mini-button" iconCls="icon-save" onclick="onOk()">保存</a>
				<span style="display:inline-block;width:25px;"></span>
				<a class="mini-button" iconCls="icon-cancel" onclick="onCancel()">取消</a>
			</div>
	    </div>
	</div>
    <script type="text/javascript">
		txkui.parse();
    	var moduleUlr="/cqzd/sysconfig/sms/";

        var form = new mini.Form("smstmpl_update_form");
        function SaveData() {
			
            form.validate();
            if (form.isValid() == false) return;
            var data=form.getData(true,true);

			HttpUtil.post(moduleUlr+"update", data, function (text) {
				if(text.errMsg){
					mini.alert("修改失败"+text.errmsg);
					return;
				}else {
					mini.alert("修改成功","成功",function(){
						txkui.closeWindow("ok");
					});
				}

	        });
        }

        function onOk(e) {

            SaveData();
        }
        function onCancel(e) {
        	txkui.closeWindow("cancel",form);
        }

		function SetData(dataP) {
			//跨页面传递的数据对象，克隆后才可以安全使用
			var data = mini.clone(dataP);
			form.setData(data);
		}

    </script>
</body>
</html>